<?php
/**
 * Created by PhpStorm.
 * User: HLG
 * Date: 2019/10/14
 * Time: 16:47
 */
namespace app\api\model;

use think\Model;

class Setting extends BaseModel
{
    protected $table = 'yoshop_setting';

    /**
     * 获取系统设置
     *
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getSetting($key = 'power', $wxapp_id = '10001')
    {
        $data = $this->getInfo(['key'=>$key,'wxapp_id'=>$wxapp_id]);
        return json_decode($data['values'],true);
    }
}
